home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / simplhlp.sit / Simple Help / stack_-1.xml < prev   
Extensible Markup Language  |  1991-04-04  |  9KB  |  21 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>2</cardCount>
  7.     <cardID>2916</cardID>
  8.     <listID>2407</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-- All of the routines in this stack are used to create and run a help system. This system is very-- simple to implement and reasonably quick depending on what options you allow.-- These scripts should be added to either the stack script or the home card. This way they-- will allways be available within any card.---- NOTE: if you use any of these handlers anywhere else in your system then you should be sure--          that you use the "PASS" command to pass the handler on. Otherwise it will never reach--          here.---- To use the system you must put the help information at the beginning of the script for a container-- whether it is a button or a field. Each "Paragraph" should start with "--" to indicate a comment-- line. The very last line of the help information should be "--EndOfHelp"-- To activate the help system hold the "OPTION" key down while moving the mouse into a container.-- The system will display all of the lines up to but not including the "--EndOfHelp" line in a card-- field called "Help". This implies that the card field must exist on each card that is processed.-- In order to work properly it must be the last card item created. Otherwise it will not appear-- on top of items where it is appropriate.-- The opencard handler does this. If you do not wish this to happen automatically then either-- delete or comment out the appropriate lines. You will then need to set up the Help field on the-- cards that you want it on. The field should be a scrolling field and have the locked text-- property set to true. This allows a mouseup within the field to be recognized.---- HANDLER DESCRIPTIONS-- OpenCard-- The first thing OpenCard does is check to see if there is a Help card field. If there isn't-- then it creates one. This section should either be deleted or commented out if you do not-- want this feature. Eliminating it will speed up going from card to card.-- Next it sets the 5 global variables that are needed for the system to work properly-- CardH, CardV, HelpH, HelpV are the size of the card and help field. They are used to be sure-- that the field will display completely within the window of the card.-- If automatic creation of a helpfield is left in then the line "If there is a card field "Help"'-- can be eliminated along with its corresponding 'end if' statement.---- CloseCard-- This has 2 functions that should not be done together since it would waste time.-- First, if the help field is there an it is visible then it will empty it and hide it. This is basically-- a reset.-- Second, the help field is deleted from the stack. If you decide to do this then you should-- comment out the first part.---- MouseEnter-- This is the heart of the system.-- First, it checks to be sure the option key is down and there is a card field called "Help".-- If the field you ask for help on is the help field then nothing happens. This could be changed-- if you wished to provide help information about itsself.-- Second, it checks to be sure there is help information available first by checking for a script-- and then by making sure there was an end of help marker (see above). The information is then-- put into the help field.-- Third, it positions the help field so that it will normally be aligned with the top of the target-- and will appear to the right of the target. Checks are made to be sure that the entire help field-- will fit on the window. Its position is adjusted accordingly. First to the left of the target, then-- above the target and then just shoved over to fit.-- Last, the field is displayed and the HelpWaitTime is set to allow 5 seconds per line for the user-- to read the information.---- MouseUp-- This is used to dismiss the help field if the user clicks in it.---- MouseWithin-- This is used to prevent idle from dismissing the help field. As long as the user places the-- pointer within the help field then the field will never be dismissed.---- idle-- If the help field is visible then it starts to time how long it has been visible. 5 seconds per line-- is allowed and then it will empty and hide the help field. If the mouse is kept within the-- help field then this will not happen.on OpenCardglobal CardH,CardV,HelpH,HelpV,HelpWaitTimeput the bottom of this card  -  the top of this card  into CardVput the right of this card  -  the left of this card into CardH-- This if-end if section should be commented out if you do not wish to have automatic-- creation of the card field "Help"if there is not a card field "Help" thenlock screendomenu "New Field"choose browse toolset the name of the last card field  to "Help"set the style of card field "Help" to "Scrolling"set the textfont of card field "Help" to Genevaset the textsize of card field "Help" to 10set the rect of card field "Help" to 0,0,250,100set the locktext of card field "Help" to trueHide card field "Help"end ifif there is a card field "Help" thenput the bottom of card field "Help" - the top of card field "Help" into HelpVput the right of card field "Help" - the left of card field "Help" into HelpHend ifpass opencardend OpenCardon CloseCardglobal HelpWaitTimeif there is a card field "Help" thenput 0 into HelpWaitTimeif visible of card field "Help" thenhide card field "Help"put empty into card field "Help"end if--This next section is used to delete the card field "Help" when the card is closed--It is not required. If you decide to use it then the part of the opencard handler--that creates the field should be uncommented.put the lockscreen into LSlock screenshow card field "Help"choose field toolclick at loc of card field "Help"domenu "clear field"choose browse toolset the lockscreen to LSend ifpass closecardend CloseCardon MouseEnterGlobal CardH,CardV,HelpH,HelpV,HelpWaitTimeif the optionkey is "Down" and there is a card field "Help" thenif the name of the target is not "card field"&&quote&"Help"&quote thenput the script of the target into junkif junk is not empty thenput offset ("--EndOfHelp",junk) into sif s > 0 thenlock screenput (the name of the target)&return&(char 1 to s-1 of junk) into card field "Help"set the textstyle of line 1 of card field "Help" to boldput the top of the target into tput the right of the target into rif r + helpH > cardH then set the right of card field "Help" to the left of the targetelse set the left of card field "Help" to rif t + HelpV > CardV then set the bottom of card field "Help" to the bottom of the targetelse set the top of card field "Help" to tif the top of card field "Help"<0 then set the top of card field "Help" to 0if the left of card field "Help"<0 then set the left of card field "Help" to 0if the right of card field "Help">CardH then set the right of card field "Help" to cardHif the bottom of card field "Help" > CardV then set the bottom of card field "Help" to cardVshow card field "Help"put the seconds + (5 * the number of lines in card field "Help") into HelpWaitTimeend ifend ifend ifend ifpass mouseenterend MouseEnterOn MouseUpif the name of the target is "card field"&&quote&"Help"&quote then hide card field "Help"pass MouseUpend MouseUpOn MouseWithinGlobal HelpWaitTimeif there is a card field "Help" thenif (visible of card field "Help") and (the mouseloc is within the rect of card field "Help") then put 0 into HelpWaitTimeend ifpass mousewithinend MouseWithinon idleglobal HelpWaitTimeif there is a card field "Help" thenif the visible of card field "Help" thenif HelpWaitTime is 0 thenput the seconds + (5 * the number of lines in card field "Help") into HelpWaitTimeelseif the seconds >= HelpWaitTime thenput empty into card field "Help"hide card field "Help"end ifend ifend ifend ifpass idleend idle</script>
  17.     <background id="2812" file="background_2812.xml" name="" />
  18.     <card id="2916" file="card_2916.xml" marked="false" name="" owner="2812" />
  19.     <card id="2283" file="card_2283.xml" marked="false" name="" owner="2812" />
  20. </stack>
  21.